<template>
    <BaseEcharts :chatsOption="chatsOption"></BaseEcharts>
</template>

<script>
    import BaseEcharts from "../../../components/common/Cahrts/coreEcharts"

    import pieBaseConfig from "../../../echartsBaseConfig/pie"

    export default {
        components: {
            BaseEcharts
        },
        props: {
            options: {}
        },
        watch: {
            options: {
                handler(val) {
                    this.chatsOption.series[0].data = val
                },
                deep: true,
                immediate: true
            }
        },
        data() {
            return {
                chatsOption: {
                    ...pieBaseConfig,
                    series: [
                        {
                            name: '作物详情',
                            type: 'pie',
                            radius: ["30%", "60%"],
                            center: ['50%', '50%'],
                            roseType: 'area',
                            selectedMode: 'single',
                            label: {
                                position: 'outer',
                                bleedMargin: 5,
                                fontSize: 40,
                                alignTo: 'labelLine',
                            },

                            labelLine: {
                                show: true,
                                length: 10,
                                length2: 150,
                            },
                            data:this.options
                        }
                    ]
                }
            }
        },

    }
</script>
